#!/usr/bin/env node

const http=require('http'),
      log=console.log,
      msg=process.argv[2]||'hello server',
      url=require('url'),
      addr='http://localhost:8080';
let opt=url.parse(addr);
opt.method='POST';

let req=http.request(opt,(res)=>{

  log(`HTTP/${res.httpVersion} ${res.statusCode} ${res.stausMessage}`);
  log(res.headers);
  res.pipe(process.stdout);
});

req.end(msg);
